<!-- 签署协议 -->
<template>

	<view class="signtHheAgreement">
		
		<view class='h6Title'>法律声明</view>
		<view class="dataTitle">{{yeartime}}年{{monthtime}}月{{daytime}}日更新</view>

		<view style="color: #666;" v-html="agreement">
			
		</view>

		<view class="sumbit-btn flex" @click="signtHheAgreementFn()">
			同意并查看
		</view>
	</view>
</template>

<script>

	
	export default {
		data() {
			const currentDate = this.getDate({
				format: true
			});
			return {
			    agreement:'',
				yeartime: currentDate.split('-')[0],
				//选择的月份
				monthtime: currentDate.split('-')[1],
				//选择的天数
				daytime: currentDate.split('-')[2],
			};
		},

		onLoad() {
              this.init()
		},

		computed: {





		},
		methods: {

 signtHheAgreementFn(){ this.$sun.navRe('/pages/index/my')},
		
            async init(){
			const res = await this.$http.post({
				url: this.$api.getHostSysConfigInfo,
			
			});
			 
			 console.log(res.data)
			 if(res.data){
				 this.agreement=res.data.legalStatement
			 }
			 
			},
			// 日期获取
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();
				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 2;
				}
			
				month = month > 9 ? month : '0' + month;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			},
		

		}
	};
</script>
<style lang="less">
	.signtHheAgreement {
		padding: 40rpx;

		.h6Title {
			color: #000;
			font-size: 40rpx;
			font-weight: 600;
			margin: 16rpx 0 24rpx 0;
		}

		.dataTitle {
			color: #000;
			font-size: 28rpx;
			font-weight: 600;
			margin-bottom: 40rpx;
		}

		.sumbit-btn {
            position: fixed;
			width: 89vw;
			bottom: 44rpx;
			margin-top: 30rpx;
			height: 100rpx;
			color: #fff;
			border-radius: 10px;
			background-color: #1890FF;
		}

	}
</style>